const { defineConfig } = require("@vue/cli-service");

const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers");

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    // proxy: {
    //   "/apis": {
    //     //代理api
    //     target:
    //       "https://www.fastmock.site/mock/4a536582a1a06d341b23b059352ed10a/vue3-ts-demo", //服务器api地址
    //     changeOrigin: true, //是否跨域
    //     pathRewrite: {
    //       //重写路径
    //       "^/apis": "",
    //     },
    //   },
    // },
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
});
